/* 按揭日报表 */
function getBaobiaoxx(url){
	$.dpAjax({
		show:true,
		url:url,
		data:{busiId:busiId},
		success: function(datas){
			 var data = datas.result;
			 if(data){
				 var html = "";
				 //按揭服务费，征信押金
				 var fundItems_ = data.fundItems_;
				 $('#baob_anjie_amount').text('-');
				 $('#baob_valueExtras').text('-');
				 if(fundItems_ && fundItems_.length > 0) {
					 for(var k = 0; k < fundItems_.length; k++) {
						 var fundItem_ = fundItems_[k];
						 var key = fundItem_.key;
						 if(key == '01') {
							 $('#baob_anjie_amount').text(showNumber(fundItem_.feeCount));
						 } else if(key == '35') {
							 $('#baob_valueExtras').text(showNumber(fundItem_.feeCount));
						 }
					 }
				 }
				 var fundTotal = data.fundTotal;
				 if(fundTotal) {
					//合计增加征信押金、按揭服务费20171220
					 $('#baob_fees_total_amount').text(showNumber(fundTotal.feeCount));
				 } else {
					 $('#baob_fees_total_amount').text('-'); 
				 }
				 
				 var fundItems = data.fundItems;
				 if(fundItems && fundItems.length > 0) {
					 var tableCount = data.tableCount
					 for(var i = 0; i < tableCount; i++) {
						 for(var j = i * 7; (j < (i + 1) * 7) && (j < fundItems.length); j++){
							var fundItemRemit = fundItems[j];
							if(j % 7 == 0){
								html += '<thead class="thead-a"><tr>';
							}else if(fundItemRemit.key == '25' || fundItemRemit.key == '03'){
								html += '<th class="warn-red-bold">' + fundItemRemit.name + '</th>';
							}else{
								html += '<th>' + fundItemRemit.name + '</th>';
							}	
							if(j % 7 == 6 || j == fundItems.length - 1) {
								html += '</tr></thead>';
							}
						 }
						 
						 for(var k = i * 7; (k < (i + 1) * 7) && (k < fundItems.length); k++){
							var fundItemFee = fundItems[k];
							if(k % 7 == 0){
								html += '<tbody class="tbody-a"><tr>';
							}else if(fundItemFee.key == '25' || fundItemFee.key == '03'){
								html += '<td class="warn-red-bold">' + showNumber(fundItemFee.feeCount) + '</td>';
							}else{
								html += '<td>' + showNumber(fundItemFee.feeCount) + '</td>';
							}
							if(k % 7 == 6 || k == fundItems.length - 1) {
								html += '</tr></tbody>';
							}
						 }
					 }
				 }
				 $('#baob_fundItems').html(html);
				 
				//按揭日表表
				var ywFees = data.ywFees;
				if(ywFees) {
					//打款账号
					$('#baob_nameBankReceiver').text(ywFees.nameBankReceiver);
					$('#baob_accountNameReceiver').text(ywFees.accountNameReceiver);
					$('#baob_accounnNoReceiver').text(ywFees.accounnNoReceiver);
					$('#baob_typeBalance').text(ywFees.typeBalanceDisplay);
					
					$('#baob_fees_amount').text(showNumber(ywFees.amount));
					$('#baob_fees_signLoanAmount').text(showNumber(ywFees.signLoanAmount));
					
					$('#baob_objectInsure1').text(ywFees.objectInsure1);
					$('#baob_objectEarnings1').text(ywFees.objectEarnings1);
					$('#baob_objectInsure2').text(ywFees.objectInsure2);
					$('#baob_objectEarnings2').text(ywFees.objectEarnings2);
					$('#baob_objectInsure3').text(ywFees.objectInsure3);
					$('#baob_objectEarnings3').text(ywFees.objectEarnings3);
					
					$('#baob_rebateDealer').text(showNumber(ywFees.rebateDealer));
					$('#baob_rebateProvince').text(showNumber(ywFees.rebateProvince));
					$('#baob_rebateArea').text(showNumber(ywFees.rebateArea));
					$('#baob_rebateTypeDisplay').text(ywFees.rebateTypeDisplay);
					
					$('#baob_creatorName').text(ywFees.creatorName);
					$('#baob_created').text(formateIntegerTime(ywFees.created,'yyyy-MM-dd hh:mm:ss'));
 				} else {
 					baob_clearFees();
 				}
 			}
         }
	});
}

function baob_clearFees() {
		$('#baob_nameBankReceiver').text('-');
		$('#baob_accounnNoReceiver').text('-');
		$('#baob_typeBalance').text('-');
		
		$('#baob_fees_amount').text('-');
		$('#baob_fees_signLoanAmount').text('-');
		
		$('#baob_objectInsure1').text('-');
		$('#baob_objectEarnings1').text('-');
		$('#baob_objectInsure2').text('-');
		$('#baob_objectEarnings2').text('-');
		$('#baob_objectInsure3').text('-');
		$('#baob_objectEarnings3').text('-');
		
		$('#baob_rebateDealer').text('-');
		$('#baob_rebateProvince').text('-');
		$('#baob_rebateArea').text('-');
		$('#baob_rebateTypeDisplay').text('-');
		
		$('#baob_creatorName').text('-');
		$('#baob_created').text('-');
}